package Servlet.Order;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class PayOrderServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.sendRedirect("Order/SuccessPay.jsp");
//        HttpSession HS = req.getSession();
//        String orderCost = req.getParameter("orderCost");
//        String orderID = req.getParameter("orderID");
//        double cost = Double.parseDouble(orderCost);
//        HS.setAttribute("orderID",orderID);
//
//        Order order = new Order();
//
//        if(order.setOrder(0.01)){
//            HS.setAttribute("code_url",order.getCoder_url());
//            HS.setAttribute("out_trade_no",order.getOut_trade_no());
//            //跳出二维码扫码支付界面
//            resp.sendRedirect("Order/Pay.jsp");
//        }
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);    }
}
